import {request} from 'network/request.js'
import Qs from 'qs'

export function updateDocument(payload){
  return request({
    url: '/updateDocument',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}

export function getAllDoc(payload){
  return request({
    url: '/getAllDoc',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}

export function updDoc(payload){
  return request({
    url: '/updDoc',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}

export function addDocument(document){
  return request({
    url: '/addDocument',
    method: "post",
    data: document
  })
}

export function getDocumentById(docId){
  return request({
    url: '/getDocumentById',
    params: {
      id: docId
    }
  })
}

export function getAllDocBySiteName(name){
  return request({
    url: '/getAllDocBySiteName',
    params: {
      siteName: name
    }
  })
}

export function listDocReceive(payload){
  return request({
    url: '/listDocReceive',
    method: "post",
    data: payload
  })
}

export function getDocByDisId(id){
  return request({
    url: '/getDocByDisId',
    params: {
      disId: id
    }
  })
}
